package org.example;

import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.Arrays;
import java.util.List;

public class Util {
    public static final String PERSISTENCE_UNIT = "my-persistence-unit";
    public static void nativeQuery(EntityManager em, String s) {
        System.out.printf("---------------------------%n'%s'%n", s);
        Query query = em.createNativeQuery(s);
        List list = query.getResultList();
        for (Object o : list) {
            System.out.println(Arrays.toString((Object[]) o));
        }
    }
}
